<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    /* 块级元素居中 */
    .box {
        width: 300px;
        height: 300px;
        background-color: aqua;
        display: table-cell;
        vertical-align: middle; /* 元素垂直居中 */
    }
    .a {
        width: 100px;
        height: 100px;
        background-color: bisque;
        margin: auto;
    } 
    </style>
</head>
<body>
    <div class="box">
        <div class="a">element</div>
    </div>
</body>
</html>